#ifndef SOCKETMANAGER_H
#define SOCKETMANAGER_H

#include <QList>
#include <QTcpSocket>
#include <QObject>
#include "../common/singleton.h"

/**
 * @brief The SocketManager class
 * @brief 管理已连接套接字
 */
class SocketManager: public QObject
{
    friend class SingleTon<SocketManager>;
private:
    SocketManager();
    SocketManager(const SocketManager&)=delete;
    SocketManager(SocketManager&&)=delete;

public:
    ~SocketManager();
    void append(QTcpSocket* socket);
    void remove(QTcpSocket* socket);
    QList<QTcpSocket*> getSockets();

private:
    QList<QTcpSocket*> sockets;

};

#endif // SOCKETMANAGER_H
